<?php


namespace dsp\builder;


class ConcreteBuilder1 implements Builder
{
    /** @var Product1 */
    private $product;

    /** initialize Product Data */
    public function __construct()
    {
        $this->reset();
    }

    /** reset Product Data */
    public function reset()
    {
        $this->product = new Product1();
    }

    /**  */
    public function producePartA()
    {
        $this->product->parts['pa1'] = 'PartA1'; // Avoid duplicate key value operations
    }

    public function producePartB()
    {
        $this->product->parts['pb1'] = 'PartB1';
    }

    public function producePartC()
    {
        $this->product->parts['pc1'] = 'PartC1';
    }

    public function getProduct()
    {
        $result = $this->product;
        $this->reset();
        return $result;
    }
}